package com.example.day04;

public class Division {
    private int x;
    private int y;

    int div() {
        return x / y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        if (y == 0) {
            System.out.println("/ By Zero!");
            System.exit(1);
        } else {
            this.y = y;
        }
    }
}

class DivTest {
    public static void main(String[] args) {
        Division division = new Division();
        division.setX(100);
        division.setY(20); // division.y = 0; ?
        System.out.println(division.div());
        System.out.println(division.getY());
    }
}
